import '@/styles/scss/default.scss'
import 'virtual:uno.css'
import 'vite/modulepreload-polyfill'
import { NaiveAdmin } from '@/admin'
import { Vue } from '@/app'

window.NaiveAdmin = NaiveAdmin

window.initApp = (config?: System.AppConfig, callback?: System.AppCallback) => {
  return new NaiveAdmin(config, callback)
}

window.initPlugin = (name: string, factory: System.ModuleFactory) => {
  if (!window[name]) {
    window[name] = {}
    factory(window[name], Vue)
    Object.defineProperty(window[name], '__esModule', { value: true })
  }
}
;(() => {})()
